home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Forms Misc / auto-fill.izs < prev    next >
Text File  |  2005-09-27  |  5KB  |  171 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Auto Fill
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>This script shows you how to set a text field value in one window by entering text in another window.<!/DESCRIPTION> 
  7.  
  8. <!CATEGORY>Forms<!/CATEGORY>
  9.  
  10. <!SCRIPT>
  11. <!-- START OF SCRIPT -->
  12.  
  13. <!-- HOW TO INSTALL AUTO FILL:
  14.  
  15.   1.  Copy code into the HEAD section of document
  16.   2.  Put last coding into the BODY section of document  -->
  17.  
  18. <!-- STEP ONE: Add code into HEAD section of document  -->
  19.  
  20. <HEAD>
  21.  
  22. <script type="text/javascript">
  23.  
  24. <!-- Original at: http://hotarea.com/ (Vladimir Geshanov) -->
  25.  
  26. <!-- Begin
  27. function explain( name, output, msg ) {
  28.     newwin = window.open( '', '', 'top=80,left=60,width=350,height=200' );
  29.     if ( !newwin.opener ) newwin.opener = self;
  30.     newwin.opener.document.bgColor = "EBEBEB";
  31.     with ( newwin.document ) {
  32.         open();
  33.         write( '<body onLoad="document.form.box.focus()">' );
  34.         write( '<form name=form ' );
  35.         write( '    onSubmit=opener.document.bgColor="EAE8E4";window.close()>' );
  36.         write( msg );
  37.         write( '<br>' );
  38.         write( '<font face=Verdana size=2>' );
  39.         write( '<p>You may enter your ' + name + ' here ' );
  40.         write( '<p>and it will be copied into the form for you.</p>' );
  41.         write( '<center>' + name + ':' );
  42.         write( '</font>' );
  43.         write( '<input type=text name=box size=10 onKeyUp=' + output + '=this.value>' );
  44.         write( ' ' );
  45.         write( '<input type=submit value="Finish">' );
  46.         write( '</center></form>' );
  47.         close();
  48.  
  49.     }
  50. }
  51. //  End -->
  52. </script>
  53. </HEAD>
  54.  
  55. <!-- STEP TWO: Add code into BODY section of document  -->
  56.  
  57. <BODY>
  58.  
  59. <div align="center">
  60.  
  61. <span class=DefMenuText>(click on "help" to open the new window)</span>
  62. <form name=form>
  63. <span class=PreText>Username:</span>
  64.     <input type=text name=username size=10>
  65.     <span class=BodyText>[<a href="javascript:explain(
  66.         'User Name',
  67.         'opener.document.form.username.value',
  68.         '<font face=Verdana size=2>' +
  69.         'The user name field is where you select a user name that ' +
  70.         'you will use every time you access this site.'
  71.     );">help</a>]</span>
  72.  
  73. <br>
  74. <span class=PreText>Password:</span>
  75.     <input type=text name=password size=10>
  76.     <span class=BodyText>[<a href="javascript:explain(
  77.         'Password',
  78.         'opener.document.form.password.value',
  79.         '<font face=Verdana size=2>' +
  80.         'The password field is where you select a unique password ' +
  81.         'for your account. This password will be required each ' +
  82.         'time you login to the site.'
  83.     );">help</a>]</span>
  84. </form>
  85. </div>
  86.  
  87. <!-- END OF SCRIPT -->
  88. <!/SCRIPT>
  89.  
  90. <!PREVIEW>
  91. <!-- START OF SCRIPT -->
  92.  
  93.  
  94. <!-- HOW TO INSTALL AUTO FILL:
  95.  
  96.   1.  Copy code into the HEAD section of document
  97.   2.  Put last coding into the BODY section of document  -->
  98.  
  99. <!-- STEP ONE: Add code into HEAD section of document  -->
  100.  
  101. <HEAD>
  102.  
  103. <script type="text/javascript">
  104.  
  105. <!-- Original at: http://hotarea.com/ (Vladimir Geshanov) -->
  106.  
  107. <!-- Begin
  108. function explain( name, output, msg ) {
  109.     newwin = window.open( '', '', 'top=80,left=60,width=350,height=200' );
  110.     if ( !newwin.opener ) newwin.opener = self;
  111.     newwin.opener.document.bgColor = "EBEBEB";
  112.     with ( newwin.document ) {
  113.         open();
  114.         write( '<body onLoad="document.form.box.focus()">' );
  115.         write( '<form name=form ' );
  116.         write( '    onSubmit=opener.document.bgColor="EAE8E4";window.close()>' );
  117.         write( msg );
  118.         write( '<br>' );
  119.         write( '<font face=Verdana size=2>' );
  120.         write( '<p>You may enter your ' + name + ' here ' );
  121.         write( '<p>and it will be copied into the form for you.</p>' );
  122.         write( '<center>' + name + ':' );
  123.         write( '</font>' );
  124.         write( '<input type=text name=box size=10 onKeyUp=' + output + '=this.value>' );
  125.         write( ' ' );
  126.         write( '<input type=submit value="Finish">' );
  127.         write( '</center></form>' );
  128.         close();
  129.  
  130.     }
  131. }
  132. //  End -->
  133. </script>
  134. </HEAD>
  135.  
  136. <!-- STEP TWO: Add code into BODY section of document  -->
  137.  
  138. <BODY>
  139.  
  140. <div align="center">
  141.  
  142. <span class=DefMenuText>(click on "help" to open the new window)</span>
  143. <form name=form>
  144. <span class=PreText>Username:</span>
  145.     <input type=text name=username size=10>
  146.     <span class=BodyText>[<a href="javascript:explain(
  147.         'User Name',
  148.         'opener.document.form.username.value',
  149.         '<font face=Verdana size=2>' +
  150.         'The user name field is where you select a user name that ' +
  151.         'you will use every time you access this site.'
  152.     );">help</a>]</span>
  153.  
  154. <br>
  155. <span class=PreText>Password:</span>
  156.     <input type=text name=password size=10>
  157.     <span class=BodyText>[<a href="javascript:explain(
  158.         'Password',
  159.         'opener.document.form.password.value',
  160.         '<font face=Verdana size=2>' +
  161.         'The password field is where you select a unique password ' +
  162.         'for your account. This password will be required each ' +
  163.         'time you login to the site.'
  164.     );">help</a>]</span>
  165. </form>
  166. </div>
  167. <!-- END OF SCRIPT -->
  168. <!/PREVIEW>
  169.  
  170. <!RELATED>NONE<!/RELATED>
  171.